import { Boot } from '@wangeditor/editor'
import formulaModule from '@wangeditor/plugin-formula'
import kityformula from '@/plugins/kityformula' // 你的自定义插件
import upLoadWord from '@/plugins/uploadWord' // 你的自定义插件

// 注册插件函数
export function registerEditorPlugins() {
  // 避免重复注册
  if (window.__WANG_EDITOR_PLUGINS_REGISTERED__) {
    return
  }

  // 注册插件
  Boot.registerMenu(kityformula)
  Boot.registerMenu(upLoadWord)
  Boot.registerModule(formulaModule)

  // 标记已注册
  window.__WANG_EDITOR_PLUGINS_REGISTERED__ = true
}

// 可选：导出插件集合
export const editorPlugins = {
  kityformula,
  upLoadWord,
  formulaModule
}
